package com.monika.main.base;

import org.springframework.core.env.PropertySources;
import org.springframework.core.env.PropertySourcesPropertyResolver;

/**
 * @author:whh
 * @date: 2025-08-06 20:54
 * <p></p>
 */
public class MyEncryptablePropertyResolver extends PropertySourcesPropertyResolver {
    /**
     * Create a new resolver against the given property sources.
     *
     * @param propertySources the set of {@link PropertySource} objects to use
     */
    public MyEncryptablePropertyResolver(PropertySources propertySources) {
        super(propertySources);
    }

    @Override
    protected String getPropertyAsRawString(String key) {

        String val = super.getPropertyAsRawString(key);

        if(val!=null && val.startsWith("CUTE@")){
            return val.replace("CUTE@","");
        }

        return val;
    }
}
